//== SAGITTARIUS ============================================================================

//== BEGINNING OF CODE ===============================================================

#include "sagittarius/core/SagittariusCore.h"

//SAGITTARIUS headers:
#include "sagittarius/parallel/np.h"
#include "sagittarius/parallel/atomics.h"

#define SG_NP_COUNT_MAX 2048
#define SG_NP_SCALE     12
#define SG_NP_CUTOFF 12 /*(SG_MAXTHR*SG_NP_SCALE)*/
sg_npt npr[SG_MAXTHR][SG_NP_COUNT_MAX];
#define SG_NP_ULTRAMAX SG_MAXTHR*SG_NP_COUNT_MAX
int nprc[SG_MAXTHR];

void nps() {
    sg_npt npll[SG_NP_ULTRAMAX];
    int k=0;
    
}

void sg_addnp(sg_npt np) {
    AT(nprc[mytid] < SG_NP_COUNT_MAX && "Increase SG_NP_COUNT_MAX");
    npr[mytid][nprc[mytid]++] = np;
    if(nprc[mytid] >= SG_NP_CUTOFF)
        nps();
}

void sg_nprt(sg_npt np) {
    sg_addnp(np);
}